package com.example.qxfw.ybzz.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.qxfw.common.entity.zy.BaseProduct;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
@DS("service")
public interface BaseProductMapper extends BaseMapper<BaseProduct> {

    @Select("select id, productname " +
            "from base_product " +
            "where forecasttime between '${time1}' and '${time2}' and  producttype='${productType}' " +
            "order by forecasttime desc,id desc ")
    List<BaseProduct> selectList5(String time1, String time2, String productType);

    @Select("select id, productname " +
            "from base_product " +
            "where forecasttime between '${time1}' and '${time2}' and  producttype='${productType}' " )
    List<BaseProduct> selectList1(String time1,String time2,String productType);

    @Select("select id, productname " +
            "from base_product " +
            "where productname = '${productName}' and producttype = '${productType}' ")
    List<BaseProduct> selectList2(String productName,String productType);

    @Select("select productname from base_product where productname = #{productName} and  producttype = #{productType}")
    List<String> selectProductName(String productName,String productType);

    @Select("select id " +
            "from base_product " +
            "where productName=#{productName}")
    List<String> selectId(String productName);
}
